package cn.qyd;

/**
 * @author 邱运铎
 * @date 2024-03-20 10:29
 */
public class FinalizeDemo {
    @Override
    protected void finalize() throws Throwable {
        System.out.println("对象被垃圾收集器收集之前，调用finalize方法");
    }

    public static void main(String[] args) {
        FinalizeDemo demo = new FinalizeDemo();
        demo = null;
        System.gc();
    }
}
